/**
 * 基础的自定义返回按钮的组件, 所有的需要显示返回按钮的都需要继承此子类,
 * 并根据需要覆盖 onNavigatorEvent 回调.
 * Created by beansoft on 2017/7/17.
 */

import React, {Component} from 'react';
import {
    Text,
    Image,
    TouchableOpacity,

} from 'react-native';

import {SCREEN_WIDTH, SCREEN_HEIGHT} from '../config';

/**
 * 用法:
 * import BComponent from '../../base';
 * export default class Settings extends BComponent { }
 */
export default class BComponent extends Component {

    constructor(props) {
        super(props);


    }

    static navigationOptions = ({ navigation }) => {
        return {
            headerLeft: () => {
                return (
                    <TouchableOpacity style={{width:50,height:50,justifyContent:"center",}} onPress={()=>{navigation.goBack()}}>
                        <Image style={{marginLeft:16}}
                               source={require('../img/common_left_black.png')}
                        />
                    </TouchableOpacity>
                );
            }
        };
    };


    render() {
        return (
            <TouchableOpacity style={{width:50,height:50,justifyContent:"center",}} onPress={()=>{this.props.navigation.goBack()}}>
                <Image style={{marginLeft:16}}
                       source={require('../img/common_left_black.png')}
                />
            </TouchableOpacity>
        );
    }

}
